#!/bin/sh

# $FreeBSD$
#
# PROVIDE: lightdm
# REQUIRE: LOGIN dbus
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable LightDM:
#	lightdm_enable="YES"
#
# lightdm_enable (bool):	Set to NO by default.
#				Set it to YES to enable LightDM.
# lightdm_logdir (path):	Set to /var/log/lightdm by default.
# lightdm_cachedir (path):	Set to /var/cache/lightdm by default.
# lightdm_rundir (path):	Set to /var/run/lightdm by default.
#

. /etc/rc.subr

name=lightdm
rcvar=lightdm_enable

load_rc_config lightdm

: ${lightdm_enable:=NO}
: ${lightdm_cachedir=/var/cache/lightdm}
: ${lightdm_logdir=/var/log/lightdm}
: ${lightdm_rundir=/var/run/lightdm}

command=%%PREFIX%%/sbin/${name}

command_args="--log-dir=${lightdm_logdir} --run-dir=${lightdm_rundir} --cache-dir=${lightdm_cachedir}"

run_rc_command "$1"
